package com.thingsgrid.mqtthelper.feign;

import org.springblade.core.launch.constant.AppConstant;
import org.springblade.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 功能说明：mqtt外部提供接口
 *
 * @author 李龙飞
 * @since 2019/8/27 9:30
 */

@FeignClient(value = AppConstant.APPLICATION_NAME_PREFIX+"mqtt-helper")
public interface MqttHelper {

	/**
	 * 接口前缀
	 */
	String API_PREFIX = "/mqtt/api";

	/**
	 *说明：调用新增接口
	 *@author lilongfei
	 *@since 2019/8/27 9:36
	 */
	@GetMapping(API_PREFIX+"/addTopic")
    R addTopic(@RequestParam("topicList") String[] topicList);

	/**
	 *说明：删除topic接口
	 *@author lilongfei
	 *@since 2019/8/27 9:38
	 */
	@GetMapping(API_PREFIX+"/removeTopic")
    R removeTopic(@RequestParam("topic") String topic);

	/**
	 *说明：发送消息
	 *@author lilongfei
	 *@since 2019/8/27 9:38
	 */
	@PostMapping(API_PREFIX+"/sendMsg")
    R sendMsg(@RequestParam("topic") String topic, @RequestParam("msg") String msg);

}
